import axios from 'axios'

interface LoginInterface {
  uacc: string
  upwd: string
}

interface RankInterface {
  uid: string | number
}

interface ScoreInterface {
  uid: string | number
  score: string | number
}

// 登录
export const postLogin = (data: LoginInterface) => {
  return axios.post('http://localhost:8989/idiom/user/login', data)
}

// 排行榜
export const getRank = (data: RankInterface) => {
  return axios.post('http://localhost:8989/idiom/game/list', data)
}

// 保存分数
export const saveScore = (data: ScoreInterface) => {
  return axios.post('http://localhost:8989/idiom/game/saveScore', data)
}